package demo1;

public class test {
    public static void main(String[] args) {
        MyLinkedList list1 = new MyLinkedList();
        list1.addFirst(1);
        list1.addFirst(2);
        list1.addFirst(3);
        list1.addFirst(4);
        list1.addFirst(5);
        System.out.println(list1.size());
        list1.addIndex(3,999);
        list1.display();
    }
    public static void main1(String[] args) {
        MySingleList list1 = new MySingleList();
        list1.addFirst(1);
        list1.addFirst(2);
        list1.addFirst(3);
        list1.addFirst(3);

        list1.addFirst(4);
        list1.addFirst(5);
        list1.addLast(6);
        list1.addFirst(3);
        list1.addIndex(3,999);
        list1.remove(5);
//        list1.remove(999);
        System.out.println(list1.size());
        System.out.println(list1.contains(4));
        System.out.println(list1.contains(6));
        System.out.println(list1.contains(999));
        list1.removeAllKey(3);
        list1.addLast(9);
        list1.display();
        list1.addFirst(1);
        list1.addFirst(1);
        list1.addFirst(1);
        list1.addFirst(1);
        list1.display();
        list1.removeAllKey2(1);
        list1.display();
        MySingleList.ListNode ret = list1.getLastKey(0);
        System.out.println(ret);

    }
}
